#ifndef WEBCLIENTSOCKET_H
#define WEBCLIENTSOCKET_H

#include <QTcpSocket>
struct StructHttpStatusLine
{
    QByteArray statusOK;
    QByteArray statusBadRequest;
    QByteArray statusNotFound;
    QByteArray statusInternalServerError;

};

struct StructContentType
{
    QByteArray contentHTML;
    QByteArray contentJPG;
};

struct StructHttpByteArray
{
   QByteArray replyBadRequest;
};

class WebClientSocket : public QTcpSocket
{
    Q_OBJECT
public:
    explicit WebClientSocket(int parID,QString strDefaultPage,QObject *parent = 0);
    ~WebClientSocket();
signals:

public slots:
    void slotReadClient();

private:
    QByteArray getReqFile(QByteArray URI);
    QByteArray getHttpHeadHtml(qint32 contentLength);
    QByteArray getHttpHeadCss(qint32 contentLength);
    QByteArray getHttpHeadJPG(qint32 contentLength);

    void initMembers();

    StructHttpStatusLine structStatLine;
    StructContentType structContentType;
    StructHttpByteArray structHttpByteArray;

    QString defaultPage;
};

#endif // WEBCLIENTSOCKET_H
